<?php if (count($languages) > 1) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
 
    <?php 
	foreach ($languages as $language) { 
		if($language_code == $language['code']) {
	?>
    
    <a id="<?php echo $language['code']; ?>" title="<?php echo $language['name']; ?>" 
    class="active"></a>
             
    <?php 
		} else {
	?>
    
    <a id="<?php echo $language['code']; ?>" title="<?php echo $language['name']; ?>" 
    onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $(this).parent().submit();"></a>
    
	<?php } 
	} ?>
    <input type="hidden" name="language_code" value="" />
    <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
  
</form>
<?php } ?>
